package day6;

import day4.teacher.MathTeacher;
import day4.teacher.PETeacher;
import day4.teacher.Teacher;
import day5.MuiscTeacher;

import java.util.HashSet;
import java.util.Set;

/**
 * @author oldliu
 * @since 1.0
 */
public class SetTest {
    public static void main(String[] args) {
        Set<String> s=new HashSet<>();
        s.add("柿子");
        s.add("苹果");
        s.add("香蕉");
        s.add("柿子");
        System.out.println(s.size());
        System.out.println(s);
        System.out.println("><>>>>>>>>>>>>><<<<<<<<<<<<<<<");
        Set<Teacher> s2=new HashSet<>();
        s2.add(new PETeacher("老张",23));
        s2.add(new MathTeacher("老张",43));
        s2.add(new MathTeacher("老张",43));
        s2.add(new MathTeacher("老黄",23));
        s2.add(new MuiscTeacher("xiaoxu",23));
        System.out.println(s2.size());
        for(Teacher t:s2){
            System.out.println(t);
        }
        boolean b = s2.remove(new MathTeacher("老张", 53));
        System.out.println("删除后：");
        System.out.println(s2);
    }
}
